/**
 * Created by oneminute on 8/13/14.
 */

var lz = require("../lib/utils/modules")();
var util = require("util");
var request = require("request");

var code = parseInt(Math.random() * 900000) + 100000;
var content = util.format(lz.Config.sms.templates.register, code);
var phone = "18653164061";
var url = util.format(lz.Config.sms.url, lz.Config.sms.account, lz.Config.sms.password, phone, content);

lz.Logger.info(url);

request(url, function (_err, _res, _body) {
    if (!_err && _res.statusCode == 200) {
        lz.Logger.debug(_body);
        //lz.Logger.debug(xmlParse(_body));
        //_callback(null, null);
    } else {
        lz.Logger.error("/requestcode: 发送短信出现错误。", _err);
        //_callback(lz.Config.errors.getError(lz.Config.errors.REQUEST_SMS_ERROR, _err));
    }
});